package com.imooc.exceptions;

import com.imooc.grace.result.ResponseStatusEnum;

/**
 * @version 1.0
 * @Author Mr.Yang
 * @Date 2024-08-05 20:19
 * @question: 自定义异常类
 */

public class MyCustomException extends RuntimeException {

    private ResponseStatusEnum responseStatusEnum;

    public MyCustomException(ResponseStatusEnum responseStatusEnum) {
        super("异常状态码为： " + responseStatusEnum.status() +
                "异常信息为： " + responseStatusEnum.msg());
        this.responseStatusEnum = responseStatusEnum;
    }

    public ResponseStatusEnum getResponseStatusEnum() {
        return responseStatusEnum;
    }

    public void setResponseStatusEnum(ResponseStatusEnum responseStatusEnum) {
        this.responseStatusEnum = responseStatusEnum;
    }
}
